Repository navigation
refactor: effect/no-unsafe-dictionary-type to zero, at error - #621
Merged
Merged
Conversation
Open dictionaries spell their value as R.ReadonlyRecord<string, unknown> (effect/Record) instead of index signatures and the built-in Record; mutable accumulators use Types.Mutable of the same. Filter.FieldTypes becomes a type alias. The rule's warn line is removed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5G6PMempKsgjiV1NDcCJY
🦋 Changeset detectedLatest commit: 8430faf The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #533.
effect/no-unsafe-dictionary-typegoes from 82 sites to 0 and itswarnline is removed fromvite.config.ts, so the rule runs aterrorfrom the preset. I counted on a tree that already had #594, so sites that a localRecordbinding used to hide are included.Every site was an open dictionary with an
unknownvalue. Wire shapes (JSON:APImeta,attributes,relationshipsandlinks) stay open, now spelledR.ReadonlyRecord<string, unknown>fromeffect/Recordinstead of a hand-written index signature or the built-inRecord. Mutable accumulators areTypes.Mutable<R.ReadonlyRecord<string, unknown>>.Other changes:
Filter.FieldTypeschanges from an interface to the equivalent type alias.Assemble.ResourceDocument.metaandClient.readTotalCount's source parameter, which had an index signature next to named members, become an intersection withR.ReadonlyRecord<string, unknown>.internal/codecs.tspasses an explicitdefine<unknown>type argument, because the mutable accumulator is now typed more precisely.vite.config.tsnow covers only theRecordinteraction withno-known-value-widening.Lint warning counts, before to after (before measured on trunk with #594 merged in):
effect(no-unsafe-dictionary-type)82 to 0. No other rule has more sites than before.effect/avoid-native-object-helpersis lower on this branch only because #615 landed on trunk in the meantime.Verification
pnpm install --frozen-lockfile: passvp run build: passvp check: pass (0 errors, 0no-unsafe-dictionary-type)vp run check: pass ("every type gate green")vp run -r test:unit: pass (4010, 73, 56 and 50 tests across the four suites)vp run docgen: passvp run test:coverage, thenvp exec fallow audit --base origin/trunk: pass (exit 0; the only finding that got worse is an inherited complexity warning inEndpoint.resource, warn only)After the final rebase onto trunk (#618) I re-ran only
vp run typecheckand the lint count, and both were clean.Changeset
.changeset/open-dictionary-readonly-record.md,patch. The respelled types are identical, so there is no migration. TheFieldTypesinterface-to-alias change shows in the emitted declarations.Notes
Filter.FieldTypesis only used as a type-parameter constraint in this repo. A consumer that merges declarations into the interface would be affected, which I judged unlikely.Ras a resource type parameter and now also import theRnamespace. A type parameter has no namespace meaning, sotscaccepts it. Renaming those parameters toResis separate work.Generated by Claude Code